package java3_16.Company;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Company company = new Company("北大青鸟","马鞍山路","123456","前端、Java全栈、UI设计");
        company.show();
        System.out.println("*******************************************");
        while (true){
            Employee employee = new Employee();
            System.out.println("1.添加新员工  2.输出员工信息  3.辞退员工  4.查看公司人数  5.退出");
            int x =scanner.nextInt();
            switch (x){
                case 1:{
                    System.out.println("请输入员工卡号：");
                    employee.setIdCard(scanner.next());
                    System.out.println("请输入员工姓名：");
                    employee.setName(scanner.next());
                    System.out.println("请输入员工年龄：");
                    employee.setAge(scanner.nextInt());
                    System.out.println("请输入员工性别：");
                    employee.setSex(scanner.next());
                    System.out.println("请输入员工职位：");
                    employee.setPost(scanner.next());
                    System.out.println("请输入员工薪水：");
                    employee.setSalary(scanner.next());
                    boolean k = company.add(employee);
                    System.out.println(k);
                    break;
                }
                case 2:{
                    company.showEmp();
                    break;
                }
                case 3:{
                    System.out.println("请输入要辞退的员工的工号：");
                    String z = scanner.next();
                    company.dismiss(z);
                    break;
                }

                case 4:{
                    int y = company.number();
                    System.out.println("一共有员工"+y+"人");
                    break;
                }
                case 5:{
                    return;
                }
            }
        }
    }
}
